const database = require('../database/index')

class GoodsService {
    // crud
    /**
     *
     * @return {Query} promise包裹的 商品数据
     * @param size
     * @param num
     */
    read(size = 10, num) {
        let limit = typeof pageSize == 'number' ? pageSize : 10;
        let offset = typeof pageNo == 'number' ? pageNo * 10 : 0
        return database.exec()
    }
    getGoodsList(sql){
        return database.exec(sql)
    }
    getGoodsTotal(){
        return database.exec(`select count(*) total from songshu.goods`)
    }
}


module.exports = goodsService = new GoodsService()
